/**
 * @author casazaft
 */
Package("j2j.net").Class("Ajax", {
    Ajax: function(){
        this.request = this.getRequest();
		var request = this.request;
		request.open("GET","http://192.168.18.7:8000",false);
		request.setRequestHeader("User-Agent", "XMLHttpRequest");
        request.setRequestHeader("Accept-Language", "en");
        request.setRequestHeader("If-Modified-Since", new Date().toString());
		request.send(null);
    },
    Prototype: function(){
        var activeX = ['MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP']
        var getRequest = function(){
            try {
                if (XMLHttpRequest) {
                    return function(){
                        return new XMLHttpRequest();
                    };
                }
            } 
            catch (e) {
                var o;
                for (var i = 0; i < activeX.length; i++) {
                    try {
                        o = new ActiveXObject(activeX[i]);
                        if (o) {
                            return function(){
                                return new ActiveXObject(activeX[i]);
                            }
                        }
						o=null;
                    } 
                    catch (e) {
                        throw Error("do not support XmlHttpRequest!");
                    }
                }
            }
        }();
        return {
            getRequest: getRequest
        }
    }()
});

